package com.chinamobile.iot.handler.model;

/**
 * the redis List item info of key : #SUB_clientId
 * Created by szl on 2017/7/26.
 * in order to reduce the data size, the field name is only one character
 */
public class RedisClientSessionSub {
    /**
     * the filter of the subscription
     */
    private String f;
    /**
     * the qos of the subscription
     */
    private int q;
    /**
     * the broker name of the client who subscribe this f
     */
    private String b;

    public String getF() {
        return f;
    }

    public void setF(String f) {
        this.f = f;
    }

    public int getQ() {
        return q;
    }

    public void setQ(int q) {
        this.q = q;
    }

    public String getB() {
        return b;
    }

    public void setB(String b) {
        this.b = b;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RedisClientSessionSub that = (RedisClientSessionSub) o;

        if (q != that.q) return false;
        if (!f.equals(that.f)) return false;
        return b != null ? b.equals(that.b) : that.b == null;
    }

    @Override
    public int hashCode() {
        int result = f.hashCode();
        result = 31 * result + q;
        result = 31 * result + (b != null ? b.hashCode() : 0);
        return result;
    }
}
